import request from '@/utils/request'

// 获取开业辅导列表
export function getGuidanceList(data) {
  return request({
    url: '/api/campus/guidance',
    method: 'get',
    data
  })
}

// 获取开业辅导详情
export function Info(id) {
  return request({
    url: `/api/campus/guidance/${id}`,
    method: 'get'
  })
}

// 创建开业辅导
export function Create(data) {
  return request({
    url: '/api/campus/guidance',
    method: 'post',
    data
  })
}

// 更新开业辅导
export function Update(data) {
  return request({
    url: '/api/campus/guidance/' + data.id,
    method: 'put',
    data
  })
}

// 删除开业辅导
export function Delete(id) {
  return request({
    url: '/api/campus/guidance/' + id,
    method: 'delete'
  })
}

// 批量删除开业辅导
export function BatchDelete(ids) {
  return request({
    url: '/api/campus/guidance/batch',
    method: 'delete',
    data: { ids }
  })
}

// 导出开业辅导数据
export function ExportData(query) {
  return request({
    url: '/api/campus/guidance/export',
    method: 'post',
    data: query,
    responseType: 'blob'
  })
}

// 获取开业辅导统计数据
export function getStatistics(query) {
  return request({
    url: '/api/campus/guidance/statistics',
    method: 'post',
    data: query
  })
}

// 提交开业辅导审核
export function SubmitAudit(id) {
  return request({
    url: '/api/campus/guidance/' + id + '/submit',
    method: 'post'
  })
}

// 审核开业辅导
export function AuditGuidance(data) {
  return request({
    url: '/api/campus/guidance/' + data.id + '/audit',
    method: 'post',
    data: data
  })
}

// 获取开业辅导审核历史
export function getAuditHistory(id) {
  return request({
    url: '/api/campus/guidance/' + id + '/audit-history',
    method: 'get'
  })
}

// 添加回访记录
export function addFollowUp(id, data) {
  return request({
    url: `/api/campus/guidance/${id}/followup`,
    method: 'post',
    data
  })
}

// 获取回访记录列表
export function getFollowUp(id, data) {
  return request({
    url: `/api/campus/guidance/${id}/followup`,
    method: 'get',
    data
  })
}

// 编辑回访记录
export function updateFollowUp(guidanceId, data) {
  return request({
    url: `/api/campus/guidance/${guidanceId}/followup/`,
    method: 'put',
    data
  })
}

// 获取开业辅导招生数据统计
export function getGuidanceEnrollmentStats(guidanceId) {
  return request({
    url: `/api/campus/guidance/${guidanceId}/enrollment-stats`,
    method: 'get'
  })
}

// 获取开业辅导阈值（及格线/达标线）
export function getGuidanceThreshold() {
  return request({
    url: '/api/campus/GuidanceThreshold',
    method: 'get'
  })
}

// 更新开业辅导阈值（及格线/达标线）
export function updateGuidanceThreshold(data) {
  return request({
    url: '/api/campus/GuidanceThreshold',
    method: 'put',
    data
  })
}
